Ajax.CachedAutocompleter = Class.create();
    Object.extend(Object.extend(Ajax.CachedAutocompleter.prototype, Autocompleter.Base.prototype), {
      initialize: function(element, update, url, options) {
        this.baseInitialize(element, update, options);
        this.options.asynchronous  = true;
        this.options.onComplete    = this.onComplete.bind(this);
        this.options.defaultParams = this.options.parameters || null;
        this.url                   = url;
        this.cache                 = {};
      },

      getUpdatedChoices: function() {
        var t = this.getToken();
        if(this.cache[t]) {
            this.updateChoices(this.cache[t]);
        } else {
            entry = encodeURIComponent(this.options.paramName) + '=' +
              encodeURIComponent(t);

            this.options.parameters = this.options.callback ?
              this.options.callback(this.element, entry) : entry;

            if(this.options.defaultParams)
              this.options.parameters += '&' + this.options.defaultParams;

            new Ajax.Request(this.url, this.options);
        }
      },
      onComplete: function(request) {
        this.updateChoices(this.cache[this.getToken()] = request.responseText);
      }
    }); 